$(function () {
    /*
    *获取账号绑定
    * */
    var userId = config.getUserId();
    var url = config.baseUrl + "user/getPhoneBind.json?userId=" + userId ;
    $.ajax({
        type: "get",
        url: url,
        dataType: "json",
        success: function (data) {
            var tempData = template('accont-template',data);
            $("#account-content").html(tempData);
        }
    })
})
/*
  *账号绑定
  *
  * */
function phoneBind() {
    var url = config.baseUrl;
    var param = {
        userId : config.getUserId(),
        phoneNum : $("#phoneNum").val(),
        password : $("#password").val()
    }
    $.ajax({
        type: "post",
        url: url + "user/phoneBind.json",
        data: param,
        dataType: "json",
        success: function (data) {
            alert(data.msg);
        }
    })
    return false;
}

/*
*删除账号绑定
* */
function deletePhoneBind(id) {
    var userId = config.getUserId();
    var url = config.baseUrl + "user/deletePhoneBind.json";
    var param = {
        userId : userId,
        id : id
    }
    $.ajax({
        type : "post",
        url : url,
        data : param,
        dataTyp : "json",
        success:function(data){
            alert(data.msg)
        }
    })
}



